#include<iostream>
#include<string>
using namespace std;

class product
{
	public:
		product()
		{
			cout<<"return a product"<<endl;
		}
};


class build
{
	public:
		build()
		{
		}
	virtual void build_partA(const string&)=0;
	virtual void build_partB(const string&)=0;
	virtual void build_partC(const string&)=0;
};

class sub_build : public build
{
	public:
		sub_build()
		{
		}

	void build_partA(const string& a)
	{
		cout<<"build_part "<<a<<endl;
	}
	void build_partB(const string& b)
	{
		cout<<"build_part "<<b<<endl;
	}
	void build_partC(const string& c)
	{
		cout<<"build_part "<<c<<endl;
	}
};

class direct
{
	public:
		direct(build* p)
		{
			t=p;
		}
		build* t;
		product* start_build()
		{
			t->build_partA("A1");
			t->build_partB("B1");
			t->build_partC("C1");
		}
};



int main()
{
	direct *d = new direct(new sub_build());
	d->start_build();
}